/*
	FileInfo:Define the attributions of world.

	Created by CaoJun 2011.10.18
*/
#ifndef __WORLD__
#define __WORLD__
#endif

#include <list>
#include "include\hge.h"
#include "include\hgesprite.h"
#include "include\hgefont.h"
#include "include\hgeparticle.h"

using namespace std;
/*
	All bubble kinds' base class
*/
class Bubble
{
protected:
	float x,y;//Define coordinates;The max of y is 1,and the max of x is ScreenWidth/ScreenHeight
	float speedx,speedy;//Define speed;The max of speedx/speedy is 1.
	float size;//Define the radius of Bubble.

	hgeSprite* spr;
public:
	const float MaxBubbleSize=0.08;
	const float MaxBubbleNum=100;
public:
	void SetCoordinate(float x,float y);
	void GetCoordinate(float* pX,float* pY);
	void SetSpeed(float speedx,float speedy);
	void GetSpeed(float* pSpeedx,float* pSpeedy);
	void SetSize(float size);
	void GetSize(float* pSize);

	virtual void DrawBubble(void);

};
/*
	Bubble with age such as BonusBubble and PlainBubble.
*/
class BubbleWithAge:public Bubble
{
protected:
	int age;//Define the age of a bubble.The unit is second.
public:
	const int MaxAge=30;//30s 
public:
	void DrawBubble(void){};
};

//Four kinds of bubble
/*

*/
class UserBubble:public Bubble
{
public:
	void DrawBubble(void);
};
class KernelBubble:public Bubble
{
public:
	void DrawBubble(void);
};
class BonusBubble:public BubbleWithAge
{
public:
	enum BonusBubbleType{A,B,C};
public:
	void DrawBubble(void);
};
class PlainBubble:public BubbleWithAge
{
public:
	void DrawBubble(void);
};

//BubbleWorld
/*
	Manage the world composed by all kinds bubbles
*/
class BubbleWorld
{
public:
	static const int UserNum=4;
private:
	UserBubble userBubbleArray[UserNum];
	KernelBubble kernelBubble;
	list<BonusBubble> bonusBubbleList;
	list<PlainBubble> plainBubbleList;

public:
	//Constructor
	BubbleWorld();
	~BubbleWorld();
	//Manage BonusBubble;
	bool CreateBonusBubble(BonusBubble::BonusBubbleType type);
	bool CreateBonusBubble(BonusBubble::BonusBubbleType type,BonusBubble* pBonusBubble);
	bool DestroyBonusBubble(BonusBubble* pBonusBubble);
	//Manage PlainBubble;
	bool CreatePlainBubble(void);
	bool CreatePlainBubble(PlainBubble* pPlainBubble);
	bool DestroyPlainBubble(PlainBubble* pPlainBubble);
private:
};
//const int BubbleWorld::UserNum=4;
/*
	Four UserBubbles' status info;
*/
class UserBubbleInfo
{
private:
	int scores;
	
};
//Used to show time last;
class TimeInfo
{
private:
	int time;
};
//Used to show debug info
class DebugInfo
{
private:
	int debuginfo;
};
static class World
{
public:
	BubbleWorld bubbleWorld;
	UserBubbleInfo userBubbleInfo[BubbleWorld::UserNum];
	TimeInfo timeInfo;
	DebugInfo debugInfo;
};